import Vue from 'vue'
import Router from 'vue-router'
import Todo from '../components/ToDo'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'todo',
      component: Todo
    },{
      path: '/finished',
      name: 'finished',
      component: Todo
    }, {
      path: '/unfinish',
      name: 'unfinish',
      component: Todo
    }
  ]
})
